/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: VP Development
 * License Type: Purchased
 */
using System;
using Orm;
using System.Collections;
using NHibernate;

namespace petshop {
	/// <summary>
	/// ORM-Persistable Class
	/// </summary>
	public class Pet {
		public Pet() {
		}
		
		public bool Save() {
			try {
				global::petshop.PetShopPersistentManager.Instance().SaveObject(this);
				return true;
			}
			catch (Exception e) {
				global::System.Console.Error.WriteLine(e.Message);
				global::System.Console.Error.WriteLine(e.StackTrace);
				throw new PersistentException(e);
			}
		}
		
		public bool Delete() {
			try {
				global::petshop.PetShopPersistentManager.Instance().DeleteObject(this);
				return true;
			}
			catch (Exception e) {
				global::System.Console.Error.WriteLine(e.Message);
				global::System.Console.Error.WriteLine(e.StackTrace);
				throw new PersistentException(e);
			}
		}
		
		public bool Refresh() {
			try {
				global::petshop.PetShopPersistentManager.Instance().GetSession().Refresh(this);
				return true;
			}
			catch (Exception e) {
				global::System.Console.Error.WriteLine(e.Message);
				global::System.Console.Error.WriteLine(e.StackTrace);
				throw new PersistentException(e);
			}
		}
		
		private int __id;
		
		private DateTime? __injection;
		
		private string __source;
		
		private string __type;
		
		private int Id {
			set {
				this.__id = value;				
			}
			get {
				return __id;				
			}
		}
		
		public int ORMID {
			get {
				return Id;				
			}
		}
		
		public DateTime? Injection {
			set {
				this.__injection = value;				
			}
			get {
				return __injection;				
			}
		}
		
		public string Source {
			set {
				this.__source = value;				
			}
			get {
				return __source;				
			}
		}
		
		public string Type {
			set {
				this.__type = value;				
			}
			get {
				return __type;				
			}
		}
		
		public override string ToString() {
			return Convert.ToString(Id);
		}
		
	}
}
